home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 21 code / Hierarchical Lists / ListDemo.r < prev    next >
Encoding:
Text File  |  1994-09-15  |  6.8 KB  |  246 lines  |  [TEXT/MMCC]

  1. // Tells PowerPlant to add our own class templates
  2. #define Include_User_Template
  3.  
  4. #include $$Shell("RIncludes") "Types.r"
  5. #include $$Shell("RIncludes") "SysTypes.r"
  6. #include $$Shell("RIncludes") "PowerPlant.r" // put alias of it in RIncludes folder!
  7.  
  8. #include "resources.h"
  9.  
  10. #define kGeneva10_Txtr        130
  11.  
  12. // ===========================================================================
  13. //        • Menu resources
  14. // ===========================================================================
  15.  
  16. resource 'MBAR' (128) {
  17.     {
  18.         128,        //    Apple
  19.         129            //    File
  20.     }
  21. };
  22.  
  23. resource 'MENU' (128) {
  24.     128, textMenuProc, allEnabled, enabled, apple,
  25.     {
  26.         "About List Demo…", noIcon, noKey, noMark, plain
  27.     }
  28. };
  29.  
  30. resource 'Mcmd' (128, "Apple") {
  31.     {
  32.         cmd_About
  33.     }
  34. };
  35.  
  36. resource 'MENU' (129) {
  37.     129, textMenuProc, 0x7FFFFB03, enabled, "File",
  38.     {
  39.         "Easy List", noIcon, noKey, noMark, plain,
  40.         "Custom List", noIcon, noKey, noMark, plain,
  41.         "Hierarchical List", noIcon, noKey, noMark, plain,
  42.         "Disk List", noIcon, noKey, noMark, plain,
  43.         "-", noIcon, noKey, noMark, plain,
  44.         "Quit", noIcon, "Q", noMark, plain
  45.     }
  46. };
  47.  
  48. resource 'Mcmd' (129, "File") {
  49.     {
  50.         cmd_EasyList,
  51.         cmd_CustomList,
  52.         cmd_HierList,
  53.         cmd_DiskList,
  54.         cmd_Nothing,
  55.         cmd_Quit
  56.     }
  57. };
  58.  
  59. // ===========================================================================
  60. //        • Window & Pane resources : Easy List
  61. // ===========================================================================
  62.  
  63. resource 'WIND' (EasyList_WIND, purgeable) {
  64.     { 47, 17, 247, 317 },
  65.     documentProc,                 // standard with size box & goAway
  66.     visible, goAway,
  67.     0x0,                        // refCon
  68.     "Easy List",
  69.     noAutoCenter
  70. };
  71.  
  72. resource 'PPob' (EasyList_PPob, purgeable) { {
  73.  
  74.     ObjectData { Window {
  75.         EasyList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  76.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  77.         100, 100,                    //    Minimum width, height
  78.         screenSize, screenSize,        //    Maximum width, height
  79.         screenSize, screenSize,        //    Standard width, height
  80.         0                            //    UserCon
  81.     } },
  82.  
  83.     BeginSubs {},
  84.  
  85.         ObjectData { ListBox {
  86.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  87.         bound, bound, bound, bound,                // bound edges to superview
  88.         -1, -1, 0, defaultSuperView,            // left, top, userRefCon
  89.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  90.         0, kGeneva10_Txtr,                        // double-click msg, text traits
  91.         textList,                                // LDEF ID
  92.         { "One", "Two", "Three", "Four", "Five" }    // some sample data
  93.         } },
  94.  
  95.     EndSubs {}
  96. } };
  97.  
  98. // ===========================================================================
  99. //        • Window & Pane resources : Custom List
  100. // ===========================================================================
  101.  
  102. resource 'WIND' (CustomList_WIND, purgeable) {
  103.     { 47, 17, 247, 317 },
  104.     documentProc,                 // standard with size box & goAway
  105.     visible, goAway,
  106.     0x0,                        // refCon
  107.     "Custom List",
  108.     noAutoCenter
  109. };
  110.  
  111. resource 'PPob' (CustomList_PPob, purgeable) { {
  112.  
  113.     ObjectData { Window {
  114.         CustomList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  115.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  116.         100, 100,                    //    Minimum width, height
  117.         screenSize, screenSize,        //    Maximum width, height
  118.         screenSize, screenSize,        //    Standard width, height
  119.         0                            //    UserCon
  120.     } },
  121.  
  122.     BeginSubs {},
  123.  
  124.         ClassAlias { 'mlst' },
  125.         ObjectData { ListBox {
  126.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  127.         bound, bound, bound, bound,            // bound edges to superview
  128.         -1, -1, 0, defaultSuperView,        // left, top, userRefCon
  129.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  130.         0, kGeneva10_Txtr,                    // double-click msg, text traits
  131.         caller_LDEF,                        // LDEF ID
  132.         {  }                                // empty list
  133.         } },
  134.  
  135.     EndSubs {}
  136. } };
  137.  
  138. // ===========================================================================
  139. //        • Window & Pane resources : Hierarchical Demo List
  140. // ===========================================================================
  141.  
  142. resource 'WIND' (HierList_WIND, purgeable) {
  143.     { 47, 17, 247, 317 },
  144.     documentProc,                 // standard with size box & goAway
  145.     visible, goAway,
  146.     0x0,                        // refCon
  147.     "Hierarchical List",
  148.     noAutoCenter
  149. };
  150.  
  151. resource 'PPob' (HierList_PPob, purgeable) { {
  152.  
  153.     ObjectData { Window {
  154.         HierList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  155.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  156.         100, 100,                    //    Minimum width, height
  157.         screenSize, screenSize,        //    Maximum width, height
  158.         screenSize, screenSize,        //    Standard width, height
  159.         0                            //    UserCon
  160.     } },
  161.  
  162.     BeginSubs {},
  163.  
  164.         ClassAlias { 'Hlst' },
  165.         ObjectData { ListBox {
  166.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  167.         bound, bound, bound, bound,            // bound edges to superview
  168.         -1, -1, 0, defaultSuperView,        // left, top, userRefCon
  169.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  170.         0, kGeneva10_Txtr,                    // double-click msg, text traits
  171.         caller_LDEF,                        // LDEF ID
  172.         {  }                                // empty list
  173.         } },
  174.  
  175.     EndSubs {}
  176. } };
  177.  
  178. // ===========================================================================
  179. //        • Window & Pane resources : Hierarchical Demo List
  180. // ===========================================================================
  181.  
  182. resource 'WIND' (DiskList_WIND, purgeable) {
  183.     { 47, 17, 247, 317 },
  184.     documentProc,                 // standard with size box & goAway
  185.     visible, goAway,
  186.     0x0,                        // refCon
  187.     "Disk List",
  188.     noAutoCenter
  189. };
  190.  
  191. resource 'PPob' (DiskList_PPob, purgeable) { {
  192.  
  193.     ObjectData { Window {
  194.         DiskList_WIND, regular, hasCloseBox, hasTitleBar, hasResize, hasSizeBox, noZoom, hasShowNew,
  195.         enabled, hasTarget, hasGetSelectClick, noHideOnSuspend, noDelaySelect, hasEraseOnUpdate,
  196.         100, 100,                    //    Minimum width, height
  197.         screenSize, screenSize,        //    Maximum width, height
  198.         screenSize, screenSize,        //    Standard width, height
  199.         0                            //    UserCon
  200.     } },
  201.  
  202.     BeginSubs {},
  203.  
  204.         ObjectData { DiskListBox {
  205.         1001, { 302, 202 }, visible, enabled,    // paneID, { width, height }
  206.         bound, bound, bound, bound,            // bound edges to superview
  207.         -1, -1, 0, defaultSuperView,        // left, top, userRefCon
  208.         hasHorizScroll, hasVertScroll, hasGrowBox, noFocusBox,
  209.         0, kGeneva10_Txtr,                    // double-click msg, text traits
  210.         caller_LDEF,                        // LDEF ID
  211.         {  }                                // empty list
  212.         } },
  213.  
  214.     EndSubs {}
  215. } };
  216.  
  217.  
  218. // ===========================================================================
  219. //        • Text style resources
  220. // ===========================================================================
  221.  
  222. resource 'Txtr' (kGeneva10_Txtr, "Geneva 10") {
  223.     10,
  224.     0,
  225.     flushDefault,
  226.     srcOr,
  227.     0,
  228.     0,
  229.     0,
  230.     useName,
  231.     "Geneva"
  232. };
  233.  
  234. // ===========================================================================
  235. //        • Apple Event-related resources
  236. // ===========================================================================
  237.  
  238. resource 'aedt' (128, "Required Suite") {
  239.     {
  240.         'aevt', 'oapp', 1001,
  241.         'aevt', 'odoc', 1002,
  242.         'aevt', 'pdoc', 1003,
  243.         'aevt', 'quit', 1004
  244.     }
  245. };
  246.